package ncc.bs.query.service.impl;

import nc.bs.dao.BaseDAO;
import nc.jdbc.framework.processor.ColumnProcessor;
import nc.vo.pub.BusinessException;
import ncc.bs.query.service.IQueryTranslateService;

public class QueryTranslateServiceImpl implements IQueryTranslateService{
	private BaseDAO baseDAO;
	@Override
	public String getFourCGProject(Object pk_fourCGProject) throws BusinessException {
		if(pk_fourCGProject == null || "".equals(pk_fourCGProject)) return "";
		String sql = this.builderFourCGProjectSQL(pk_fourCGProject);
		Object obj = this.getBaseDAO().executeQuery(sql, new ColumnProcessor());
		return obj == null ? "" : obj.toString();
	}
	
	/**
	 * 构建四级项目名称查询
	 * @param pk_fourCGProject
	 * @return
	 * @throws BusinessException
	 */
	private String builderFourCGProjectSQL(Object pk_fourCGProject) throws BusinessException{
		return "select name from hrpbm_sjxmh where dr = 0 and pk_sjxm = '"+pk_fourCGProject+"'";
	}
	
	public BaseDAO getBaseDAO() {
		return baseDAO == null ? new BaseDAO() : baseDAO;
	}

}
